<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0px;
            margin: 0px;
        }
        body {
            display: flex;
            justify-content: center;
        }
        .wrap {
            width: 80%;
            height: 2000px;
            background: rgba(233, 240, 99, 0.734);
        }
        .box1 {
            width: 100px;
            height: 200px;
            background: rgb(230, 71, 79);
             /*不会释放文档流*/
            position: relative;
            top: 50px;
            left: 50px;
        }
        .box2 {
            width: 100px;
            height: 200px;
            background: rgba(141, 208, 245, 0.66);
        }
    </style>
</head>
<body>
    <div class="wrap">
        <h1>相对定位</h1>
        <div class="box1"></div>
        <div class="box2"></div>
    </div>
</body>
</html>